<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=utf-8" errorPage="/error.jsp" isELIgnored="false" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.opensymphony.com/oscache" prefix="cache" %>
<%@ taglib uri="http://atleap.blandware.com/taglib" prefix="atleap" %>
<html:xhtml />

<atleap:constants className="com.blandware.atleap.webapp.util.core.WebappConstants" var="CONTENT_PAGES_COLLECTION_KEY" />
<atleap:constants className="com.blandware.atleap.webapp.util.core.WebappConstants" var="CONTENT_PAGE_URLS_COLLECTION_KEY" />
<atleap:constants className="com.blandware.atleap.webapp.util.core.WebappConstants" var="CONTENT_PAGES_GRID" />
<atleap:constants className="com.blandware.atleap.webapp.util.core.WebappConstants" var="FOLDERS_COLLECTION_KEY" />
<atleap:constants className="com.blandware.atleap.webapp.util.core.WebappConstants" var="CURRENT_PATH_KEY" />
<atleap:constants className="com.blandware.atleap.webapp.util.core.WebappConstants" var="GRID_PAGE_SIZE" />
<atleap:constants className="com.blandware.atleap.webapp.util.core.LinkedObjectsInfoContainer" var="TYPE_PAGE" />
<atleap:constants className="com.blandware.atleap.webapp.util.core.LinkedObjectsInfoContainer" var="TYPE_RESOURCE" />
<atleap:constants className="org.apache.struts.Globals" var="LOCALE_KEY" />
<c:set var="language" value="${sessionScope[pageScope.LOCALE_KEY].language}" />
<atleap:globalProperty name="${pageScope.GRID_PAGE_SIZE}" defaultValue="10" type="integer" var="pageSize" />
<c:set value="${requestScope[pageScope.CURRENT_PATH_KEY]}" var="currentPath" />
<c:set var="path" value="/" />
<c:if test="${currentPath.numberOfFolders> 1}">
	<atleap:iterator items="${currentPath.folders}" var="folder" end="${currentPath.numberOfFolders - 2}">
		<atleap:rewriteUrl action="/core/contentPage/list"  var="folderLink">
			<atleap:param name="currentFolder" value="${folder.fullPath}" />
		</atleap:rewriteUrl>
		<c:set var="folderLink" value="<a href=\"${folderLink}\">${folder.name}</a>" />
	    <c:set var="path" value="${path}${folderLink}/" />
    </atleap:iterator>
</c:if>
<c:if test="${currentPath.numberOfFolders> 0}">
	<c:set var="path" value="${path}${currentPath.lastFolder.name}/" />	
</c:if>

<atleap:isUserInRole roles="core-contentPage-changeActivity" var="canChangeActivity" />
<atleap:isUserInRole roles="core-contentPage-assignRoles" var="canAssignRoles" />
<atleap:isUserInRole roles="core-contentPage-update" var="canUpdate" />
<atleap:isUserInRole roles="core-contentPage-view" var="canView" />
<atleap:isUserInRole roles="core-contentPage-delete" var="canDelete" />
<atleap:isUserInRole roles="core-linkedObjects-view" var="canViewLinkedObjects" />

<c:set var="infoCells" value="5" />
<c:set var="constantButtonCells" value="1" />
<c:set var="additionalCells" value="0" />
<c:if test="${canChangeActivity}">
	<c:set var="additionalCells" value="${additionalCells+1}" />
</c:if>
<c:if test="${canAssignRoles}">
	<c:set var="additionalCells" value="${additionalCells+1}" />
</c:if>
<c:if test="${canUpdate}">
	<c:set var="additionalCells" value="${additionalCells+1}" />
</c:if>
<c:if test="${canView}">
	<c:set var="additionalCells" value="${additionalCells+1}" />
</c:if>
<c:if test="${canDelete}">
	<c:set var="additionalCells" value="${additionalCells+1}" />
</c:if>

<c:set var="folderAdditionalCells" value="0" />
<c:if test="${canUpdate}">
	<c:set var="folderAdditionalCells" value="${folderAdditionalCells+1}" />
</c:if>
<c:if test="${canDelete}">
	<c:set var="folderAdditionalCells" value="${folderAdditionalCells+1}" />
</c:if>

<atleap:content identifier="information" ignore="true" />
<atleap:grid name="${pageScope.CONTENT_PAGES_GRID}" pageSize="${pageSize}">
    <atleap:messages property="noLayoutFound" />
    <atleap:messages property="contentPageNotFound" />
    <atleap:messages property="ownerNotFound" />
    <atleap:messages property="virtualFolderIsEmpty" />
    <atleap:messages property="someContentPageAlreadyExists" />
    <atleap:messages property="someUpdateFailed" />
    <atleap:messages property="someContentPageIncorrectUri" />
    <atleap:messages property="someOwnerNotFound" />
    <table border="0" cellpadding="0" cellspacing="0" class="grid">
        <thead>
            <tr>
                <th  colspan="${infoCells + constantButtonCells + additionalCells}">
                    <atleap:message key="core.commons.currentPath" arg0="${path}" />
                </th>
            </tr>
            <tr>
                <th nowrap="nowrap">
                    <atleap:column fieldName="title.simpleValue" fieldKey="core.page.form.title">
                        <atleap:sort property="title(${language})" rowIterators="pageIterator">
                            <atleap:message key="${fieldKey}" />
                            <atleap:sortAsc>
                                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/grid/ascSort.gif" />"  />
                            </atleap:sortAsc>
                            <atleap:sortDesc>
                                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/grid/descSort.gif" />"  />
                            </atleap:sortDesc>
                        </atleap:sort>
                        <atleap:stringFilter>
                            <atleap:filterEnabled>
                                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/grid/filterEnabled.gif" />"  />
                            </atleap:filterEnabled>
                            <atleap:filterDisabled>
                                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/grid/filterDisabled.gif" />"  />
                            </atleap:filterDisabled>
                         </atleap:stringFilter>                        
                    </atleap:column>
                </th>
                <th nowrap="nowrap">
                    <atleap:column fieldName="page.uri" fieldKey="core.page.form.uri">
                        <atleap:sort property="uri" rowIterators="pageIterator">
                            <atleap:message key="${fieldKey}" />
                            <atleap:sortAsc>
                                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/grid/ascSort.gif" />"  />
                            </atleap:sortAsc>
                            <atleap:sortDesc>
                                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/grid/descSort.gif" />"  />
                            </atleap:sortDesc>
						</atleap:sort>
                    </atleap:column>
                </th>
                <th nowrap="nowrap">
                    <atleap:column fieldName="page.layout.name" fieldKey="core.contentPage.form.layout">
                        <atleap:sort property="layout.name" rowIterators="pageIterator">
                            <atleap:message key="${fieldKey}" />
                            <atleap:sortAsc>
                                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/grid/ascSort.gif" />"  />
                            </atleap:sortAsc>
                            <atleap:sortDesc>
                                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/grid/descSort.gif" />"  />
                            </atleap:sortDesc>
                        </atleap:sort>
                        <atleap:setFilter beanId="lookupManager" method="listLayouts" label="name" value="definition" fieldName="page.layout.definition">
                            <atleap:filterEnabled>
                                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/grid/filterEnabled.gif" />"  />
                            </atleap:filterEnabled>
                            <atleap:filterDisabled>
                                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/grid/filterDisabled.gif" />"  />
                            </atleap:filterDisabled>
                         </atleap:setFilter>
                    </atleap:column>
                </th>
                <th nowrap="nowrap">
                    <atleap:column fieldName="description.simpleValue" fieldKey="core.page.form.description">
                        <atleap:sort property="description(${language})" rowIterators="pageIterator">
                            <atleap:message key="${fieldKey}" />
                            <atleap:sortAsc>
                                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/grid/ascSort.gif" />"  />
                            </atleap:sortAsc>
                            <atleap:sortDesc>
                                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/grid/descSort.gif" />"  />
                            </atleap:sortDesc>
                            </atleap:sort>
                        <atleap:stringFilter>
                            <atleap:filterEnabled>
                                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/grid/filterEnabled.gif" />"  />
                            </atleap:filterEnabled>
                            <atleap:filterDisabled>
                                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/grid/filterDisabled.gif" />"  />
                            </atleap:filterDisabled>
                         </atleap:stringFilter>
                    </atleap:column>
                </th>
                <th nowrap="nowrap">
                    <atleap:column fieldName="role.name" fieldKey="core.contentPage.form.role">
                        <atleap:message key="core.contentPage.form.roles" />
                        <atleap:setFilter beanId="lookupManager" method="listRolesAssignedToContentPages" value="name" label="title">                        
                            <atleap:filterEnabled>
                                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/grid/filterEnabled.gif" />"  />
                            </atleap:filterEnabled>
                            <atleap:filterDisabled>
                                <img border="0" src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/grid/filterDisabled.gif" />"  />
                            </atleap:filterDisabled>
                         </atleap:setFilter>
                    </atleap:column>
                </th>
                <c:if test="${constantButtonCells + additionalCells > 0}">
                    <th colspan="${constantButtonCells + additionalCells}">
                        <img src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/spacer.gif" />" border="0"  />
                    </th>
                </c:if>
            </tr>
        </thead>
        <tbody>
            <atleap:contextMenu var="folderMenuId">
                <atleap:rowsIterator tagId="folderIterator" var="folder" collection="${requestScope[pageScope.FOLDERS_COLLECTION_KEY]}" oddClass="oddRow" evenClass="evenRow">
                    <atleap:itemSet>
                        <atleap:rewriteUrl action="core/contentPage/list" var="defaultUrl">
                            <atleap:param name="currentFolder" value="${folder.fullPath}" />
                        </atleap:rewriteUrl>
                        <tr class="${rowClass}" oncontextmenu="return showContextMenu(${folderMenuId}, event, ${indexId});" onclick="dispatchGridTrClick(event, this, &#039;${defaultUrl}&#039;);">
                            <td colspan="${infoCells + constantButtonCells + additionalCells - (folder.parentFolder ? 0 : folderAdditionalCells)}">
                                <atleap:link action="core/contentPage/list">
                                    <atleap:param name="currentFolder" value="${folder.fullPath}" />
                                    /<c:out value="${folder.name}" escapeXml="true" />
                                </atleap:link>
                            </td>
                            <atleap:item includeInPage="false">
                                <atleap:itemEnabled>
                                    <atleap:message key="core.commons.folders.openFolder" var="openFolderMsg" />
                                    <atleap:itemLink action="core/contentPage/list" title="${openFolderMsg}">
                                        <atleap:param name="currentFolder" value="${folder.fullPath}" />
                                        <atleap:itemLabel>
                                            ${openFolderMsg}
                                        </atleap:itemLabel>
                                    </atleap:itemLink>
                                </atleap:itemEnabled>
                            </atleap:item>
                            <atleap:item includeInContextMenu="${canUpdate && !folder.parentFolder}" includeInPage="${canUpdate && !folder.parentFolder}">
                                <td align="center" width="20" height="20" valign="middle" class="defaultCursorCell">
                                    <atleap:itemEnabled>
                                        <atleap:message key="core.commons.buttons.moveFolder" var="moveFolderMsg" />
                                        <atleap:itemLink action="core/contentPage/callMoveFolder" title="${moveFolderMsg}">
                                            <atleap:param name="path" value="${folder.fullPath}" />
                                            <img src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/edit.gif" />" border="0" title="${moveFolderMsg}" alt="${moveFolderMsg}" align="absmiddle" />
                                            <atleap:itemLabel>
                                                ${moveFolderMsg}
                                            </atleap:itemLabel>
                                        </atleap:itemLink>
                                    </atleap:itemEnabled>
                                </td>
                            </atleap:item>
                            <atleap:item includeInContextMenu="${canDelete && !folder.parentFolder}" includeInPage="${canDelete && !folder.parentFolder}">
                                <td align="center" width="20" height="20" valign="middle" class="defaultCursorCell">
                                    <atleap:itemEnabled>
                                        <atleap:message key="core.commons.buttons.delete" var="deleteTitle"/>
                                        <atleap:itemLink action="core/contentPage/deleteFolder" transaction="true" confirmExpression="confirmDelete();" title="${deleteTitle}">
                                            <atleap:param name="path" value="${folder.fullPath}" />
                                            <img src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/delete.gif" />" border="0" title="${deleteTitle}" alt="${deleteTitle}" align="absmiddle" />
                                            <atleap:itemLabel>
                                                ${deleteTitle}
                                            </atleap:itemLabel>
                                        </atleap:itemLink>
                                    </atleap:itemEnabled>
                                </td>
                            </atleap:item>
                        </tr>
                    </atleap:itemSet>
                </atleap:rowsIterator>
            </atleap:contextMenu>
            <atleap:contextMenu var="menuId">
                <atleap:rowsIterator tagId="pageIterator" var="contentPage" collection="${requestScope[pageScope.CONTENT_PAGES_COLLECTION_KEY]}" oddClass="oddRow" evenClass="evenRow">
                    <atleap:itemSet>
                        <c:set var="confirmDeleteScript" value="return confirmDelete();" />
                        <atleap:rewriteUrl action="core/contentPage/view" var="defaultUrl">
                            <atleap:param name="id" value="${contentPage.id}" />
                        </atleap:rewriteUrl>
                        <c:set var="onTrClickCode" value="" />
                        <c:set var="tdClass" value="defaultCursorCell" />
                        <c:if test="${canView}">
                            <c:set var="onTrClickCode" value="dispatchGridTrClick(event, this, &#039;${defaultUrl}&#039;);" />
                            <c:set var="tdClass" value="pointerCursorCell" />
                        </c:if>
                        <tr class="${rowClass}" oncontextmenu="return showContextMenu(${menuId}, event, ${indexId});" onclick="${onTrClickCode}">
                            <td class="${tdClass}">
                                <atleap:fieldValue valueMap="${contentPage.title}" />
                            </td>
                            <td class="${tdClass}">
                                <c:out value="${requestScope[pageScope.CONTENT_PAGE_URLS_COLLECTION_KEY][contentPage.id]}" escapeXml="true" />
                            </td>
                            <td class="${tdClass}"><c:out value="${contentPage.layout.name}" escapeXml="true" /></td>
                            <td class="${tdClass}">
                                <atleap:fieldValue valueMap="${contentPage.description}" />
                            </td>
                            <td class="${tdClass}"><c:out value="${contentPage.rolesAsString}" escapeXml="true" /></td>
                            <atleap:item includeInContextMenu="${canChangeActivity}" includeInPage="${canChangeActivity}">
                                <td align="center" width="20" height="20" valign="middle" class="defaultCursorCell">
                                    <atleap:itemEnabled>
                                        <c:choose>
                                            <c:when test="${contentPage.active}">
                                                <atleap:message key="core.page.buttons.makeInactive" var="makeInactiveMsg" />
                                                <atleap:itemLink action="core/contentPage/changeActivity?mode=inactive" title="${makeInactiveMsg}" transaction="true">
                                                    <atleap:param name="id" value="${contentPage.id}" />

                                                            <img src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/active.gif" />" border="0" title="${makeInactiveMsg}" alt="${makeInactiveMsg}" align="absmiddle" />
                                                            <atleap:itemLabel>
                                                                ${makeInactiveMsg}
                                                            </atleap:itemLabel>
                                                </atleap:itemLink>
                                            </c:when>
                                            <c:otherwise>
                                                <atleap:message key="core.page.buttons.makeActive" var="makeActiveMsg" />
                                                <atleap:itemLink action="core/contentPage/changeActivity?mode=active" title="${makeActiveMsg}" transaction="true">
                                                    <atleap:param name="id" value="${contentPage.id}" />
													<img src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/inactive.gif" />" border="0" title="${makeActiveMsg}" alt="${makeActiveMsg}" align="absmiddle" />
													<atleap:itemLabel>
														${makeActiveMsg}
													</atleap:itemLabel>
                                                </atleap:itemLink>
                                            </c:otherwise>
                                        </c:choose>
                                    </atleap:itemEnabled>
                                </td>
                            </atleap:item>
                            <atleap:item includeInContextMenu="${canAssignRoles}" includeInPage="${canAssignRoles}">
                                <td align="center" width="20" height="20" valign="middle" class="defaultCursorCell">
                                    <atleap:itemEnabled>
                                        <atleap:message key="core.commons.buttons.assignRoles" var="assignRolesMsg"/>
                                        <atleap:itemLink action="core/contentPage/callAssignRoles" title="${assignRolesMsg}">
                                            <atleap:param name="contentPageId" value="${contentPage.id}" />
											<img src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/assign_roles.gif" />" border="0" title="${assignRolesMsg}" alt="${assignRolesMsg}" align="absmiddle" />
											<atleap:itemLabel>
												${assignRolesMsg}
											</atleap:itemLabel>
                                        </atleap:itemLink>
                                    </atleap:itemEnabled>
                                </td>
                            </atleap:item>
                            <atleap:item includeInContextMenu="${canUpdate}" includeInPage="${canUpdate}">
                                <td align="center" width="20" height="20" valign="middle" class="defaultCursorCell">
                                    <atleap:itemEnabled>
                                        <atleap:message key="core.commons.buttons.callUpdate" var="callUpdateMsg" />
                                        <atleap:itemLink action="core/contentPage/callUpdate" title="${callUpdateMsg}">
                                            <atleap:param name="id" value="${contentPage.id}" />
											<img src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/edit.gif" />" border="0" title="${callUpdateMsg}" alt="${callUpdateMsg}" align="absmiddle" />
											<atleap:itemLabel>
												${callUpdateMsg}
											</atleap:itemLabel>
                                        </atleap:itemLink>
                                    </atleap:itemEnabled>
                                </td>
                            </atleap:item>
                            <atleap:item includeInContextMenu="${canView}" includeInPage="${canView}">
                                <td align="center" width="20" height="20" valign="middle" class="defaultCursorCell">
                                    <atleap:itemEnabled>
                                        <atleap:message key="core.commons.buttons.view" var="viewMsg"/>
                                        <atleap:itemLink action="core/contentPage/view" title="${viewMsg}">
                                            <atleap:param name="id" value="${contentPage.id}" />
											<img src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/view.gif" />" border="0" title="${viewMsg}" alt="${viewMsg}" align="absmiddle" />
											<atleap:itemLabel>
												${viewMsg}
											</atleap:itemLabel>
                                        </atleap:itemLink>
                                    </atleap:itemEnabled>
                                </td>
                            </atleap:item>
                            <atleap:item>
                                <td align="center" width="20" height="20" valign="middle" class="defaultCursorCell">
                                    <atleap:itemEnabled>
                                        <atleap:message key="core.commons.buttons.open" var="openMsg"/>
                                        <atleap:itemLink href="${contentPage.uri}" target="_blank" title="${openMsg}">
											<img src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/open.gif" />" border="0" title="${openMsg}" alt="${openMsg}" align="absmiddle" />
											<atleap:itemLabel>
												${openMsg}
											</atleap:itemLabel>
                                        </atleap:itemLink>
                                    </atleap:itemEnabled>
                                </td>
                            </atleap:item>
                            <atleap:item includeInPage="false" includeInContextMenu="${canViewLinkedObjects}">
                                <atleap:itemEnabled>
                                    <atleap:message key="core.commons.buttons.viewLinkedObjects" var="viewLinkedObjectsMsg"/>
                                    <atleap:itemLink action="core/linkedObjects/view?id=${contentPage.id}&type=${TYPE_PAGE}&justView=true" title="${viewLinkedObjectsMsg}">
                                        <atleap:rewriteUrl action="/core/contentPage/list" var="thisRedirectUrl" />
                                        <atleap:param name="redirectUrl" value="${thisRedirectUrl}" />
											<atleap:itemLabel>
												${viewLinkedObjectsMsg}
											</atleap:itemLabel>
                                    </atleap:itemLink>
                                </atleap:itemEnabled>
                            </atleap:item>
                            <atleap:item includeInContextMenu="${canDelete}" includeInPage="${canDelete}">
                                <td align="center" width="20" height="20" valign="middle" class="defaultCursorCell">
                                    <atleap:itemEnabled>
                                        <atleap:message key="core.commons.buttons.delete" var="deleteTitle"/>
                                        <atleap:itemLink action="core/contentPage/delete" title="${deleteTitle}" confirmExpression="confirmDelete();" transaction="true">
                                            <atleap:param name="id" value="${contentPage.id}" />
											<img src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/delete.gif" />" border="0" title="${deleteTitle}" alt="${deleteTitle}" align="absmiddle" />
											<atleap:itemLabel>
												${deleteTitle}
											</atleap:itemLabel>
                                        </atleap:itemLink>
                                    </atleap:itemEnabled>
                                </td>
                            </atleap:item>
                        </tr>
                    </atleap:itemSet>
                </atleap:rowsIterator>
            </atleap:contextMenu>
            <atleap:noRows>
                <tr>
                    <td class="tfoot" colspan="${infoCells + constantButtonCells + additionalCells}" align="center">
                        <em><atleap:message key="core.commons.nothingToShow"/></em>
                    </td>
                </tr>
            </atleap:noRows>
        </tbody>
        <tfoot>
            <tr>
                <atleap:pager pageCount="10">
                    <td colspan="${infoCells + constantButtonCells + additionalCells}" align="center">
                        <atleap:message key="core.grid.pager.title" />&nbsp;
                        <atleap:firstPage><img src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/first.gif" />" border="0" alt="<atleap:message key="core.grid.pager.first"/>" title="<atleap:message key="core.grid.pager.first"/>" /></atleap:firstPage>
                        <atleap:prevPage><img src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/prev.gif" />" border="0" alt="<atleap:message key="core.grid.pager.prev"/>" title="<atleap:message key="core.grid.pager.prev"/>" /></atleap:prevPage>
                        <atleap:pagesIterator>
                            <atleap:page>${pageNumber}&nbsp;</atleap:page>
                            <atleap:currentPage><b>${pageNumber}</b>&nbsp;</atleap:currentPage>
                        </atleap:pagesIterator>
                        <atleap:nextPage><img src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/next.gif" />" border="0" alt="<atleap:message key="core.grid.pager.next"/>" title="<atleap:message key="core.grid.pager.next"/>" /></atleap:nextPage>
                        <atleap:lastPage><img src="<atleap:rewriteUrl href="/images/theme/${appConfig['adminCssTheme']}/last.gif" />" border="0" alt="<atleap:message key="core.grid.pager.last"/>" title="<atleap:message key="core.grid.pager.last"/>" /></atleap:lastPage>
                    </td>
                </atleap:pager>
            </tr>
        </tfoot>
    </table>
    <atleap:isUserInRole roles="core-contentPage-create">
        <atleap:form action="core/contentPage/callCreate?uri=${currentPath}" method="POST" validateOnSubmit="false">
            <atleap:submit styleClass="button" disabled="${!requestScope.isCPCreate}"><atleap:message key="core.commons.buttons.create" /></atleap:submit>
        </atleap:form>
    </atleap:isUserInRole>
</atleap:grid>


